﻿@using TimerTask.Common.Utils
@{
    ViewBag.Title = "定时任务系统 - 登录";
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>@ViewBag.Title</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link href="/lib/bootstrap/dist/css/bootstrap.min.css?v=@AppConfig.Instance.Ver" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="/css/font-awesome.min.css?v=@AppConfig.Instance.Ver" rel="stylesheet">
    <!-- Ionicons -->
    <link rel="stylesheet" href="/lte/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/lte/css/AdminLTE.min.css">
    <!-- 以上为公共css -->

</head>
<body class="sidebar-mini ajax-template skin-blue fixed login-page">
    <div class="login-box">
        <div class="login-logo">
            <b>T.T</b>
        </div>
        <!-- /.login-logo -->
        <div class="login-box-body">
            <p class="login-box-msg">Sign in to start your session</p>

            <form method="post">
                <div class="form-group has-feedback">
                    <input type="text" class="form-control" name="userName" placeholder="用户名" required="required">
                    <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                </div>
                <div class="form-group has-feedback">
                    <input type="password" class="form-control" placeholder="密码" required="required">
                    <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <button type="button" class="btn btn-primary btn-block btn-flat" id="btnSubmit">
                            登 录
                        </button>
                    </div>
                    <!-- /.col -->
                </div>
            </form>

            <!-- /.social-auth-links -->
        </div>
        <!-- /.login-box-body -->
    </div>
    <script src="/lib/jquery/dist/jquery.min.js?v=@AppConfig.Instance.Ver"></script>
    <script type="text/javascript">
        $('#btnSubmit')
            .click(
                function () {
                    var postData = {};
                    postData.userName = $('input[name=userName]').val();
                    postData.pwd = $('input[name=pwd]').val();
                    $.post('@Url.Action("Login")', postData, function (result) {
                        if (result.code === 1) {
                            window.location.href = result.data;
                            return;
                        }
                        alert(result.msg);
                    });
                });
    </script>
</body>
</html>
